<?php

declare(strict_types=1);

namespace SixShop\Wangdian\Exception;

/**
 * Base exception for all Wangdian SDK exceptions
 */
abstract class WangdianException extends \Exception
{
    public function __construct(
        string $message = '',
        int $code = 0,
        ?\Throwable $previous = null,
        protected readonly ?array $context = null
    ) {
        parent::__construct($message, $code, $previous);
    }

    /**
     * Get additional context information
     */
    public function getContext(): ?array
    {
        return $this->context;
    }
}